package dialog;

import gui.GUI;

import java.util.ArrayList;

import launch.SimpleTest;

import org.newdawn.slick.Color;

public class DialogDeroulement {

	private String name;
	private ArrayList<Replique> l_repliques;
	private ArrayList<Replique> choix = new ArrayList<Replique>();
	
	public DialogDeroulement(String n){
		this.name = n;
		this.l_repliques = new ArrayList<Replique>();
	}
	
	public String getName(){
		return name;
	}
	
	public void AddReplique(Replique r){
		l_repliques.add(r);
	}
	
	public Replique getReplique(int i){
		for(Replique r : l_repliques){
			if(r.getNumero() == i){
				return r;
			}
		}
		return null;
	}
	
	public void choose(int timebefore){
		choix = new ArrayList<Replique>();
		for(Replique r : l_repliques){
			if(r.accessible()){
				choix.add(r);
			}
		}
		
		GUI.addChoose(choix,SimpleTest.getHeros(),Color.black,new Color(1f,1f,1.0f,0.5f),this,timebefore);
	}
	
	public void exit(){
		SimpleTest.changePlayerCommands(true);
	}
}
